// 容器组件
import 'package:flutter/material.dart';

class ContainerCase extends StatelessWidget {
  const ContainerCase({super.key});

  @override
  Widget build(BuildContext context) {
    return Container(
      width: 100,
      height: 100,
      padding: const EdgeInsets.all(20),
      margin: const EdgeInsets.all(20),
      decoration: BoxDecoration(
        borderRadius: BorderRadius.circular(20),
        border: Border.all(
          color: Colors.red,
          width: 2,
        ),
        // 阴影
        boxShadow: const [
          BoxShadow(
            color: Colors.black,
            offset: Offset(0, 0),
            blurRadius: 10,
          ),
        ],
        //变色
        gradient: const LinearGradient(
          colors: [
            Colors.red,
            Color.fromARGB(255, 90, 47, 47),
            Color.fromARGB(255, 255, 255, 255),
            Color.fromARGB(255, 90, 47, 47),
            Colors.red,
          ],
        ),

      ),
    //居中  
    alignment: Alignment.center,
    // 子组件居中
    child: const Text('你好 Flutter!',
      style: TextStyle(
        fontSize: 20,
        color: Colors.white,
      ),
    ),
    );
  }
}
